Set errno to 0 before calling strtoul
authorAlexander Larsson <alexl@redhat.com>
Tue, 7 Apr 2009 13:32:16 +0000 (15:32 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 7 Apr 2009 13:32:16 +0000 (15:32 +0200)
We check errno for failure, so ensure its cleared first. (#573922)

gtk/gtkwindow.c

index 6dce1485c709dbd7e455141f160c34740d166932..4bbd53e0cea3a819d0f84c53f10d1b9f48523b96 100644 (file)
@@ -395,7 +395,8 @@ extract_time_from_startup_id (const gchar* startup_id)
     
       /* Skip past the "_TIME" part */
       timestr += 5;
-    
+
+      errno = 0;
       timestamp = strtoul (timestr, &end, 0);
       if (end != timestr && errno == 0)
         retval = timestamp;